#include <iostream>
#include <algorithm>
using namespace std;

signed main()
{
    int n,m;
    cin>>n>>m;
    int a[10005];
    for(int i=0;i<n;i++)    cin>>a[i];
    int ans = 0;
    for(int i=0;i<n;i++){
        int sum = 0;
        for(int j=i;j<n;j++){
            sum += a[j];
            if(sum<=m)    ans++;
            else break;
        }
    }
    cout<<ans;
    return 0;
}
